<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>采购表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/layui.css" media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
</head>
<body>

	<div class="demoTable" style="margin-left: 20px; margin-top: 10px;">
		
		开始时间：
		<div class="layui-inline">
			<input class="layui-input" style="height: 32px;" name="id" id="date"
				placeholder="yyyy-MM-dd" autocomplete="off">
		</div>
		-截止时间:
		<div class="layui-inline">
			<input class="layui-input" name="id" id="time" style="height: 32px;"
				placeholder="yyyy-MM-dd" autocomplete="off">
		</div>
		状态:
		<from class="layui-form">
		<div class="layui-inline">
			<select lay-filter="aihao" id="state" style="width: 100px; border: 1px solid red;">
				<option value="">====请选择====</option>
				<option value="1">等待审核</option>
				<option value="2">财务审核通过</option>
				<option value="3">审核通过</option>
				<option value="4">审核不通过</option>
			</select>
		</div>
		</from>

		<button class="layui-btn layui-btn-sm" data-type="reload" id="selectButton">搜索</button>
		<button class="layui-btn layui-btn-warm layui-btn-sm" id="insert">增加</button>

	</div>
<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>
	<table class="layui-table" lay-data="{ url:'../../sncompurchase/findAll.action', page:true, id:'idTest'}" lay-filter="demo">
		<thead>
			<tr>
				<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
				<th lay-data="{field:'purId',width:'100', fixed: true, align:'center'}">采购ID</th>
				<th lay-data="{field:'braName',width:'150', align:'center'}">分公司名</th>
				<th lay-data="{field:'purSum',width:'80', align:'center'}">总金额</th>
				<th lay-data="{field:'optime',width:'160', align:'center', sort: true}">操作时间</th>
				<th lay-data="{field:'sort',width:'100', align:'center',templet:'#shenh'}">审核状态</th>
				<th lay-data="{field:'userName',width:'80', align:'center'}">操作人</th>
				<th lay-data="{field:'purCount',width:'80', align:'center'}">总数量</th>
				<th lay-data="{fixed: 'right', align:'center', width:'240', toolbar: '#barxqing'}">详情</th>
				<th lay-data="{fixed: 'right', width:'150', align:'center', toolbar: '#barDemo'}">操作</th>
			</tr>
		</thead>
	</table>





	<!-- 采购 -->
	<div id="add" style="display: none;">
	
		<div class="demoTable2" style="margin-left: 20px; margin-top: 10px;">
				商品名称:
				<div class="layui-inline">
					<input class="layui-input" name="id" id="comName" style="height: 32px;">
				</div>
		
				商品类型:
				<from class="layui-form">
					<div class="layui-inline">
						<select lay-filter="aihao" id="typeId" style="width: 100px; border: 1px solid red;">
							<option value="">====请选择====</option>
						</select>
					</div>
				</from>
			<button class="layui-btn" data-type="reload" id="selectButton2">搜索</button>
			
			<button class="layui-btn" data-type="reload" id="yijiantianjia">一键添加</button>
		</div>
		
		<table id="fuxkuang" class="layui-table" lay-data="{id:'idTest2'}" lay-filter="demo2">
			
		</table>
		
		
		<input type="text" style="width:700px;display:none;" id="comId"/>
		<table class="layui-table">
			<thead>
				<tr>
					<th>商品名称</th>
					<th>商品单位</th>
					<th>商品价格</th>
					<th>商品数量</th>
					<th>价格小计</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody id="tab">
				
			</tbody>
		</table>
		
	</div>
	
	<!-- 商品详情 -->
	<div id="add2" style="display: none;">
	
		<table class="layui-table" lay-data="{ url:'../../financeschasesnaudit/findFinances.action', page:true, id:'idTest3'}" lay-filter="demo3">
			<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'comName', align:'center'}">商品名称</th>
					<th lay-data="{field:'comUnit', align:'center'}">商品单位</th>
					<th lay-data="{field:'pdMoney', align:'center'}">商品价格</th>
					<th lay-data="{field:'pdNumber', align:'center'}">商品数量</th>
					<th lay-data="{field:'pdSum', align:'center'}">价格小计</th>
				</tr>
			</thead>
		</table>
	</div>
	
	<div id="add3" style="display:none;">
 	     <div class="layui-form-item layui-form-text">
		    <label class="layui-form-label">采购意见</label>
		    <div class="layui-input-block">
		      <textarea id="shenheyijian" placeholder="请输入内容" class="layui-textarea" style="width:280px;margin-top:10px;"></textarea>
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <div class="layui-input-block">
		      <button id="zuihoutijiao" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		    </div>
		  </div>
	</div>
	
	
	<!-- 审核详情 -->
	<div id="add4" style="display: none;">
		<table class="layui-table" lay-data="{ url:'../../sncompurchase/snaudit.action', page:true, id:'idTest4'}" lay-filter="demo3">
			<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'optime', align:'center'}">审核时间</th>
					<th lay-data="{field:'oper', align:'center'}">审核人</th>
					<th lay-data="{field:'auState', align:'center',templet:'#zhungtai'}">审核状态</th>
					<th lay-data="{field:'auIdea', align:'center'}">审核意见</th>
					<th lay-data="{field:'auComment', align:'center'}">审核部门</th>
				</tr>
			</thead>
		</table>
	</div>
	
	<!-- 商品详情 -->
	<div id="add5" style="display: none;">
		<div class="layui-form-item layui-form-text">
		    <label class="layui-form-label">退货备注</label>
		    <div class="layui-input-block">
		      <textarea id="tuihuobeizhu" placeholder="请输入内容" class="layui-textarea" style="width:400px;height:40px;margin-top:10px;"></textarea>
		    </div>
		</div>
		<button id="qdingtuihuo" style="margin-left:110px;" class="layui-btn" lay-submit lay-filter="formDemo">确定退货</button>
		<button id="zhongz" style="margin-left:40px;" class="layui-btn" lay-submit lay-filter="formDemo">重置</button>
		<table class="layui-table" lay-data="{ url:'../../financeschasesnaudit/findFinances.action', page:true, id:'idTest5'}" lay-filter="demo5">
			<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'comId', align:'center'}">商品ID</th>
					<th lay-data="{field:'comName', align:'center'}">商品名称</th>
					<th lay-data="{field:'comUnit', align:'center'}">商品单位</th>
					<th lay-data="{field:'pdMoney', align:'center'}">商品价格</th>
					<th lay-data="{field:'pdNumber', align:'center',toolbar:tuiHuoShuLiang}" >退货数量</th>
				</tr>
			</thead>
		</table>
		
	</div>
	<!-- 退货详情 -->
	<div id="add6" style="display: none;">
		<table class="layui-table" lay-data="{ url:'../../sncompurchase/findAllComSaDetail.action', page:true, id:'idTest6'}" lay-filter="demo6">
			<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'sdId', align:'center'}">详情ID</th>
					<th lay-data="{field:'csId', align:'center'}">退货ID</th>
					<th lay-data="{field:'comName', align:'center'}">商品名称</th>
					<th lay-data="{field:'sdCount', align:'center'}">退货数量</th>
				</tr>
			</thead>
		</table>
	</div>
	
	
<script type="text/html" id="tuiHuoShuLiang">
 <input type="text" name="123" id="{{d.comId}}" required lay-verify="required" value="{{d.pdNumber}}" autocomplete="off" class="layui-input" style="border:0px;" onkeyup="number(this)">
</script>


    <script type="text/html" id="Images">
    	<img style="width:30px;height:23px;" src="../../{{ d.comImage }}">
	</script>

	<script type="text/html" id="barxqing">
  		<button class="layui-btn layui-btn-xs" lay-event="spxq">商品详情</button>
		{{# if(d.isva == 0) { }}
		<button class="layui-btn layui-btn-xs" lay-event="tjsh">提交审核</button>
		{{# } else if(d.isva == 1){ }}
		<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">等待审核</button>
		{{# } else if(d.isva == 2){ }}
		<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">等待审核</button>
		{{# } else if(d.isva == 3){ }}
		<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">等待审核</button>
		{{# } else if(d.isva == 4){ }}
		<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">等待审核</button>
		{{# } else if(d.isva == 5){ }}
		<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">已审核</button>
		{{# } else if(d.isva == 20){ }}
		<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">已入库</button>	
		{{# } else if(d.isva == 21){ }}
		<button class="layui-btn layui-btn-xs" lay-event="thxq">退货详情</button>
		{{# } else if(d.isva == 22){ }}
		<button class="layui-btn layui-btn-xs" lay-event="thxq">退货详情</button>
		{{# }}}
  		<button class="layui-btn layui-btn-xs" lay-event="shxq">审核详情</button>
	</script>


		<script type="text/html" id="barDemo"> 
			{{# if(d.isva == 0) { }}
  			<button class="layui-btn layui-btn-xs bj" lay-event="edit">编辑</button>
  			<button class="layui-btn layui-btn-danger layui-btn-xs sc" lay-event="del">删除</button>
			{{# } else if(d.isva == 1){ }}
			<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">编辑</button>
  			<button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled" disabled="disabled">删除</button>
			{{# } else if(d.isva == 2){ }}
			<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">编辑</button>
  			<button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled" disabled="disabled">删除</button>
			{{# } else if(d.isva == 3){ }}
			<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">编辑</button>
  			<button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled" disabled="disabled">删除</button>
			{{# } else if(d.isva == 4){ }}
			<button class="layui-btn layui-btn-xs layui-btn-disabled" disabled="disabled">编辑</button>
  			<button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled" disabled="disabled">删除</button>
			{{# } else if(d.isva == 5){ }}
			<button class="layui-btn layui-btn-xs" lay-event="ruku" >入库</button>
			<button class="layui-btn layui-btn-xs layui-btn-danger" lay-event="tuihuo">退货</button>
			{{# } else if(d.isva == 20){ }}
			<button class="layui-btn layui-btn-xs layui-btn-disabled" lay-event="ruku" disabled="disabled">入库</button>
			<button class="layui-btn layui-btn-xs layui-btn-disabled" lay-event="tuihuo" disabled="disabled">退货</button>
			{{# } else if(d.isva == 21){ }}
			<button class="layui-btn layui-btn-xs" lay-event="ruku">入库</button>
			<button class="layui-btn layui-btn-xs layui-btn-disabled" lay-event="tuihuo" disabled="disabled">正在退货</button>
			{{# } else if(d.isva == 22){ }}
			<button class="layui-btn layui-btn-xs" lay-event="ruku">入库</button>
			<button class="layui-btn layui-btn-xs" lay-event="tuihuo">退货修改</button>
			{{# }}}
		</script>
		<script type="text/javascript" id="shenh">
			 {{# if(d.sort == 1) { }}
		     <div>等待审核</div>
		 	 {{# } else if(d.sort == 2){ }}
		    <div>财务审核通过,等待总经理审核</div>
			 {{# } else if(d.sort == 4){ }}
				<div>审核不通过</div>
			{{# } else if(d.sort == 3){ }}
			 <div>审核通过</div>
			{{# }}}
		
		</script>
		<script type="text/javascript" id="zhungtai">
			 {{# if(d.auState == 1) { }}
		     <div>通过</div>
		 	 {{# } else if(d.auState == 0){ }}
		     <div>未通过</div>
		     {{# } else if(d.auState == null){ }}
		     <div>未通过</div>
			 {{# }}}
		</script>
			
		
	

	<script src="../../res/layui.all.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../res/js/wq/sncompurchase.js"></script>
</body>
</html>
